
#ifndef ROPUFU_CALL_RESULT_HPP_INCLUDED
#define ROPUFU_CALL_RESULT_HPP_INCLUDED

#include <cstdint>
#include <string>

namespace ropufu
{
	enum class call_result
	{
		success = 0x00,
		argument_null = 0x01,
		argument_out_of_range = 0x02,
		index_out_of_range = 0x03,
		not_supported = 0x10,
		interrupted = 0x40,
		unhandled_exception = 0x80
	};
}

namespace std
{
    std::string to_string(ropufu::call_result value)
	{
		switch (value)
		{
        case ropufu::call_result::success: return "success";
        case ropufu::call_result::argument_null: return "argument null";
        case ropufu::call_result::argument_out_of_range: return "argument out of range";
        case ropufu::call_result::index_out_of_range: return "index out of range";
        case ropufu::call_result::not_supported: return "not supported";
        case ropufu::call_result::interrupted: return "interrupted";
        case ropufu::call_result::unhandled_exception: return "unhandled exception";
		default: return std::to_string(static_cast<std::int32_t>(value));
		}
	};
}

#endif // ROPUFU_CALL_RESULT_HPP_INCLUDED
